package com.bigdatastudio.common.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * <h2>用户</h2>
 *
 * @author xiao_jie
 * @since 2022-09-12
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_user")
//@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
public class User implements Serializable {

    /**
     * <h3>版本控制</h3>
     */
    private static final long serialVersionUID = 1L;

    /**
     * <h3>用户编号</h3>
     */
    @TableId(value = "id", type = IdType.AUTO)
    @NotNull
    private Integer id;

    /**
     * <h3>用户账户</h3>
     */
    private String loginName;

    /**
     * <h3>用户密码</h3>
     */
    private String password;

    /**
     * <h3>真实名字</h3>
     */
    private String userName;

    /**
     * <h3>注册邮箱</h3>
     */
    private String email;

    /**
     * <h3>账号状态（0正常 1停用）</h3>
     */
    private Boolean status;

    /**
     * <h3>创建人</h3>
     */
    private String createName;

    /**
     * <h3>创建时间</h3>
     */
    //    @JsonFormat(pattern = "yyyy-MM-dd")  // 返回给前端的时候进行格式化
    private String createTime;

    /**
     * <h3>修改人</h3>
     */
    private String updateName;

    /**
     * <h3>修改时间</h3>
     */
    //    @JsonFormat(pattern = "yyyy-MM-dd")  // 返回给前端的时候进行格式化
    private String updateTime;

    /**
     * <h3>逻辑删除（1：已删除 0：未删除）</h3>
     */
    private Boolean isDelete;

    /**
     * <h3>备注</h3>
     */
    private String remark;

    @Transient
    @TableField(exist = false)
    private List<Role> roles;
}
